3.201 \(\int \frac{\csc (x)}{\sec (x)-\tan (x)} \, dx\)

Optimal. Leaf size=13 \[ \log (\sin (x))-\log (1-\sin (x)) \]

[Out]

-Log[1 - Sin[x]] + Log[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0620936, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {4391, 2707, 36, 29, 31} \[ \log (\sin (x))-\log (1-\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(Sec[x] - Tan[x]),x]

[Out]

-Log[1 - Sin[x]] + Log[Sin[x]]

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2707

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^(m - (p + 1)/2))/(a - x)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{\csc (x)}{\sec (x)-\tan (x)} \, dx &=\int \frac{\cot (x)}{1-\sin (x)} \, dx\\ &=\operatorname{Subst}\left (\int \frac{1}{x (1+x)} \, dx,x,-\sin (x)\right )\\ &=\operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,-\sin (x)\right )-\operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,-\sin (x)\right )\\ &=-\log (1-\sin (x))+\log (\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.0220258, size = 22, normalized size = 1.69 \[ \log (\sin (x))-2 \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(Sec[x] - Tan[x]),x]

[Out]

-2*Log[Cos[x/2] - Sin[x/2]] + Log[Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.09, size = 8, normalized size = 0.6 \begin{align*} -\ln \left ( -1+\csc \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(sec(x)-tan(x)),x)

[Out]

-ln(-1+csc(x))

________________________________________________________________________________________

Maxima [A]  time = 1.01512, size = 34, normalized size = 2.62 \begin{align*} -2 \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) + \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(sec(x)-tan(x)),x, algorithm="maxima")

[Out]

-2*log(sin(x)/(cos(x) + 1) - 1) + log(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [A]  time = 0.487989, size = 49, normalized size = 3.77 \begin{align*} \log \left (\frac{1}{2} \, \sin \left (x\right )\right ) - \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(sec(x)-tan(x)),x, algorithm="fricas")

[Out]

log(1/2*sin(x)) - log(-sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc{\left (x \right )}}{- \tan{\left (x \right )} + \sec{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(sec(x)-tan(x)),x)

[Out]

Integral(csc(x)/(-tan(x) + sec(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.12615, size = 19, normalized size = 1.46 \begin{align*} -\log \left (-\sin \left (x\right ) + 1\right ) + \log \left ({\left | \sin \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(sec(x)-tan(x)),x, algorithm="giac")

[Out]

-log(-sin(x) + 1) + log(abs(sin(x)))